package 力扣_二分查找.旋转数组系列.特例;

/**
 * @author zx
 * @create 2022-10-15 18:06
 */
public class 旋转数组的最小数字剑指Offer_11 {
    public int minArray(int[] numbers) {
        int left = 0, right = numbers.length - 1;
        while (left <= right) {
            int mid = left + ((right - left) >> 1);
            if (numbers[mid] < numbers[right]) {
                right = mid;
            } else if (numbers[mid] > numbers[right]) {
                left = mid + 1;
            } else if(numbers[mid] == numbers[right]){
                right--;
            }
        }
        return numbers[left];
    }
}
